package com.bruan.junit_test;

import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

/***
 * 测试类
 */
public class StringUtilTest {
    @Before
    public void testBegin(){
        System.out.println("============================");
    }
    @After
    public void testAfter(){
        System.out.println("=============================");
    }
    @Test
    public void testPrintTest(){
        StringUtil.printNumber("admin");
        StringUtil.printNumber(null);
    }
    @Test
    public void testGetMaxIndex(){
        int index1 = StringUtil.getMaxIndex(null);
        System.out.println(index1);
        int index2 = StringUtil.getMaxIndex("admin");
        System.out.println(index2);

        //断言机制 预测内部机制
        Assert.assertEquals("内部有bug",index2);
    }
}
